package com.ruoyi.purchase.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.purchase.mapper.PurchaseAuditMapper;
import com.ruoyi.purchase.domain.PurchaseAudit;
import com.ruoyi.purchase.service.IPurchaseAuditService;
import com.ruoyi.common.core.text.Convert;

/**
 * 采购审核记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-17
 */
@Service
public class PurchaseAuditServiceImpl implements IPurchaseAuditService 
{
    @Autowired
    private PurchaseAuditMapper purchaseAuditMapper;

    /**
     * 查询采购审核记录
     * 
     * @param id 采购审核记录主键
     * @return 采购审核记录
     */
    @Override
    public PurchaseAudit selectPurchaseAuditById(Long id)
    {
        return purchaseAuditMapper.selectPurchaseAuditById(id);
    }

    /**
     * 查询采购审核记录列表
     * 
     * @param purchaseAudit 采购审核记录
     * @return 采购审核记录
     */
    @Override
    public List<PurchaseAudit> selectPurchaseAuditList(PurchaseAudit purchaseAudit)
    {
        return purchaseAuditMapper.selectPurchaseAuditList(purchaseAudit);
    }

    /**
     * 新增采购审核记录
     * 
     * @param purchaseAudit 采购审核记录
     * @return 结果
     */
    @Override
    public int insertPurchaseAudit(PurchaseAudit purchaseAudit)
    {
        return purchaseAuditMapper.insertPurchaseAudit(purchaseAudit);
    }

    /**
     * 修改采购审核记录
     * 
     * @param purchaseAudit 采购审核记录
     * @return 结果
     */
    @Override
    public int updatePurchaseAudit(PurchaseAudit purchaseAudit)
    {
        return purchaseAuditMapper.updatePurchaseAudit(purchaseAudit);
    }

    /**
     * 批量删除采购审核记录
     * 
     * @param ids 需要删除的采购审核记录主键
     * @return 结果
     */
    @Override
    public int deletePurchaseAuditByIds(String ids)
    {
        return purchaseAuditMapper.deletePurchaseAuditByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除采购审核记录信息
     * 
     * @param id 采购审核记录主键
     * @return 结果
     */
    @Override
    public int deletePurchaseAuditById(Long id)
    {
        return purchaseAuditMapper.deletePurchaseAuditById(id);
    }
}
